package com.mzxy.cloud.controller;


import com.mzxy.cloud.apis.PayFeignApi;
import com.mzxy.cloud.entities.PayDTO;
import com.mzxy.cloud.resp.ResultData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class OrderController {
    @Autowired
    private PayFeignApi payFeignApi;
    @PostMapping("/feign/pay/add")
    public ResultData addOrder(@RequestBody PayDTO payDTO){
        ResultData resultData = payFeignApi.addPay(payDTO);
        return resultData;
    }
    @GetMapping(value = "/feign/pay/get/{id}")
    public ResultData getById(@PathVariable("id") Integer id){
        ResultData pay = payFeignApi.getById(id);
        return pay;
    }
    @GetMapping("/feign/pay/get/info")
    public String getInfoByConsul(){
        String mylb = payFeignApi.mylb();
        return mylb;
    }
}
